package generalpattern.diagram.edit.policies;

import generalpattern.diagram.edit.commands.Component3CreateCommand;
import generalpattern.diagram.edit.commands.ComponentPortCreateCommand;
import generalpattern.diagram.edit.commands.Connector2CreateCommand;
import generalpattern.diagram.edit.commands.Pattern2CreateCommand;
import generalpattern.diagram.providers.GeneralPatternMetamodelElementTypes;

import org.eclipse.gef.commands.Command;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;

/**
 * @generated
 */
public class ComponentComponentCompartment3ItemSemanticEditPolicy extends
		GeneralPatternMetamodelBaseItemSemanticEditPolicy {

	/**
	 * @generated
	 */
	public ComponentComponentCompartment3ItemSemanticEditPolicy() {
		super(GeneralPatternMetamodelElementTypes.Component_2023);
	}

	/**
	 * @generated
	 */
	protected Command getCreateCommand(CreateElementRequest req) {
		if (GeneralPatternMetamodelElementTypes.ComponentPort_3026 == req
				.getElementType()) {
			return getGEFWrapper(new ComponentPortCreateCommand(req));
		}
		if (GeneralPatternMetamodelElementTypes.Component_3027 == req
				.getElementType()) {
			return getGEFWrapper(new Component3CreateCommand(req));
		}
		if (GeneralPatternMetamodelElementTypes.Connector_3028 == req
				.getElementType()) {
			return getGEFWrapper(new Connector2CreateCommand(req));
		}
		if (GeneralPatternMetamodelElementTypes.Pattern_3030 == req
				.getElementType()) {
			return getGEFWrapper(new Pattern2CreateCommand(req));
		}
		return super.getCreateCommand(req);
	}

}
